package club.emergency.wechat.model.authorization;

import club.emergency.wechat.model.GenericEntity;
import com.baomidou.mybatisplus.annotation.TableField;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.fasterxml.jackson.databind.ser.std.ToStringSerializer;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

/**
 * Create with IntelliJ IDEA
 * Project Name: wechat
 * Package Name: club.emergency.wechat.model.authorization
 * Date: 2019/3/14
 *
 * @author: 快乐的小菌菌
 * Description:
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
public class Authorization extends GenericEntity {

    /**
     * 权限关键字
     */
    private String keyName;

    /**
     * 权限别名
     */
    private String alias;

    /**
     * 匹配字段
     */
    private String code;

    /**
     * 父id
     */
    @JsonSerialize(using = ToStringSerializer.class)
    private Long parentId;

    /**
     * 自动迁移算法slot,禁止修改
     */
    @TableField(exist = false)
    private Integer slot;
}
